<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
    展示玩家数据
--%>
<html>
    <head>
        <title>Title</title>
        <%
            String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/";
            /*
             * request.getScheme() : http
             * request.getServerName() : localhost
             * request.getServerPort() : 端口号
             * request.getContextPath() : /获取虚拟目录名(项目名jsp_framework)
             * */
        %>
        <base href="<%=basePath%>">
        <script src="js/jquery-3.3.1.js"></script>

    </head>
    <body>

        <script>
            $(function () {
                $("#forwardID").click(function () {
                    $.get("communication/forward",{},function (data) {
                        alert(data);
                    });
                })
            });
        </script>
        <input type="button" value="异步-请求转发  (没有页码跳转,页码被放在了ajax的data中)" id="forwardID"><br>
        <a href="communication/forward">同步-请求转发</a><br><br><br><br>



        <script>
            $(function () {
                $("#redirectID").click(function () {
                    $.get("communication/redirect",{},function (data) {
                        alert(data);
                    });
                })
            });
        </script>
        <input type="button" value="异步-请求重定向" id="redirectID"><br>
        <a  href="communication/redirect">同步-请求重定向</a><br>


    </body>
</html>










